home *** CD-ROM | disk | FTP | other *** search
/ NOVA - For the NeXT Workstation / NOVA - For the NeXT Workstation.iso / Documents / NeXTAnswers / postscript.428 < prev    next >
Text File  |  1992-02-06  |  1KB  |  50 lines

  1. {\rtf0\ansi{\fonttbl\f1\fnil Times-Roman;\f0\fswiss Helvetica;}
  2. \paperw13040
  3. \paperh10200
  4. \margl120
  5. \margr120
  6. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\f1\b0\i0\ul0\fs28 pswrap image \
  7. \
  8. Q: I have a PS file with an image (and some data) in it.  It works fine in Yap, but doesn't work if I put it in a .psw file.  What's wrong?\
  9. \
  10. A:  In most cases files with image data use the 
  11. \b currentfile
  12. \b0  operator to cause the image to be loaded from the currently interpreted file.  This paradigm doesn't work from within a 
  13. \b pswrap
  14. \b0  function, where the PostScript has been compiled. Say you have the following PostScript segment:\
  15. \
  16.  
  17. \b     /picstr 8 string def\
  18.     0 0 translate 320 320 scale\
  19.     8 8 1 [8 0 0 -8 0 8] \{currentfile picstr readhexstring pop\} image\
  20.     0123456789abcdef\
  21.  
  22. \b0\i \
  23.  
  24. \i0 The data for the image is coming from the PostScript procedure 
  25. \b \{currentfile picstr readhexstring pop\}
  26. \b0 , which expects the data to be laid out right after the 
  27. \b image
  28. \b0 .   This is what breaks in the psw file, and the fix is to provide the data through some alternate means. One possibility is to provide the data in the procedure itself:\
  29.  
  30. \i \
  31.  
  32. \b\i0     0 0 translate 320 320 scale\
  33.     8 8 1 [8 0 0 -8 0 8] \{<0123456789abcdef>\} image\
  34.  
  35. \b0     \
  36. See the 
  37. \b image
  38. \b0  operator in the Adobe Blue and Red books for more details.\
  39.  
  40. \i \
  41.  
  42. \i0 QA428
  43. \i \
  44.  
  45. \i0 \
  46. Valid for 1.0\
  47. Valid for 2.0\
  48. \
  49.  
  50.